/********************************************************************************
 *      Copyright:  (C) 2025 chenhongyu IOT STUDY
 *                  All rights reserved.
 *
 *       Filename:  mqtt.h
 *    Description:  This file 
 *
 *        Version:  1.0.0(17/07/25)
 *         Author:  chenhongyu <chenhongyu0822@163.com>
 *      ChangeLog:  1, Release initial version on "17/07/25 22:43:22"
 *                 
 ********************************************************************************/
#ifndef _MQTT_H
#define _MQTT_H

#include <mosquitto.h>
#include <dbus/dbus.h>

#include "main.h"

extern struct mosquitto *mqtt_get_client();

extern void on_message(struct mosquitto *mosq, void *userdata, const struct mosquitto_message *message);

extern int mqtt_connect(bled_t *ctx);

extern int mqtt_publish(const char *topic, const uint8_t *buf, size_t len);

extern void mqtt_cleanup();

extern void *mqtt_thread(void *arg);

#endif

